import Vue from 'vue'
import Vuex from 'vuex'
import sessionUtil from '../utils/sessionUtil'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    defaultIndex: '',
    user: {}
  },
  mutations: {
    setUser (state, user) {
      state.user = user
    },
    setUserSession (state) {
      state.user = sessionUtil.session.get('user')
    }
  },
  actions: {}
})
